﻿using KZ.Express.ENT;
using KZ.Express.Presenter;
using KZ.Express.Resource;
using System;

namespace KZ.Express.Setup.PriceList
{
    public partial class ZoneListView : FormBase
    {
        #region Private Variables

        bool _isVisible;

        #endregion

        #region Private Methods

        private void ZoneListView_Load(object sender, EventArgs e)
        {
            base.LoadData();
        }

        private void ZoneListView_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible && !_isVisible)
                base.LoadData();
            _isVisible = this.Visible;
        }

        #endregion Private Methods

        #region Constructors

        public ZoneListView()
        {
            InitializeComponent();
            base.ObjectID = (int)Objects.Zone;

            base.OrderBy = "ZoneCode";
            base.OrderDirection = "ASC";

            base.Action = ActionName.List;
            base.InitializeDataGrid(dtgZone);
            base._presenter = new PresenterBase(this, new ZoneENT());

            dtgZone.ColumnHeaderMouseClick += dtg_ColumnHeaderMouseClick;
        }

        #endregion Constructors
    }
}